package com.me.mygdxgame.Components;

import com.me.mygdxgame.Component;

public class Health extends Component{
	
	int maxHealth;
	int curHealth;
	
	public int getCurHealth(){
		return curHealth;
	}
	public int getMaxHealth(){
		return maxHealth;
	}
	public int getHealthPercentage(){
		return curHealth/maxHealth;
	}
	public Health(int maxHealth){
		this.maxHealth = maxHealth;
		this.curHealth = maxHealth;
	}
	public void reduceHealth(int amount){
		this.curHealth -= amount;
		if(this.curHealth <= 0){
			die();
		}
	}
	public void die(){
		// TODO: add die animation, remove component from parent
	}
}
